import Vue from 'vue'
// 设置状态显示的颜色
Vue.directive('status',{
    inserted(el,binding){
        var status = ["2天之内关单","1周内关单","长期跟单","无效量"];
        var index = binding.value;
        var colors = ['lightgreen','LightGoldenrodYellow','LightCyan','WhiteSmoke'];
        el.style.backgroundColor = colors[index-1];
        // statusStyle.backgroundColor = colors[value-1];
    }
})

//获取职业
Vue.directive('occupation',{
    inserted(el,binding){
        var axios = Vue.prototype.$http;
        var occupationURL = window.baseURL+"/backstage/config/find?kkey="+binding.value+"&token="+Vue.prototype.$token+"&ktype=occupation";
        axios.get(occupationURL)
        .then((response)=>{
            el.innerHTML = response.data.data.kvalue;
        })
    }
})

export default {}
